<?php
class BriefController extends CI_Controller {
    protected function _auth()
    {
        if (!$this->auth->isLogin()) throw new MyException('',MyException::AUTH);
	}

	function group(){
		if (!$this->auth->isAdmin()) $this->db->where_in('belong',$this->auth->dept);
		$data=$this->db->select('id,name')->get('gup')->result_array();
		restful(200,$data);
	}

	function department(){
		if (!$this->auth->isAdmin()) $this->db->where_in('id',$this->auth->dept);
		$data=$this->db->select('id,parentId,name')->get('department')->result_array();
		restful(200,$data);
	}
}
